package com.hksj.cbm.controller;

import com.hksj.cbm.service.DictionaryService;
import com.hksj.cbm.vo.DictionaryItemVO;
import com.hksj.common.core.model.Rest;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * @author zengke
 * @version 1.0
 * @see DictionaryController
 * @since 2024/7/17 18:00
 */

@Api(tags = "基础模块-字典管理")
@RequestMapping("/api/dictionary")
@RestController
public class DictionaryController {

    @Autowired
    private DictionaryService dictionaryService;

    @ApiOperation(value = "查询字典明细集合")
    @PostMapping("/queryDictionaryItemMap")
    public Rest<Map<String, List<DictionaryItemVO>>> queryDictionaryItemMap(){
        Map<String, List<DictionaryItemVO>> result = dictionaryService.queryDictionaryMap();
        return Rest.ok(result);
    }
}
